<?php
  session_cache_limiter('private,must-revalide');
   /**
   * 处理上传页面
   */ 
    include_once("../config.php");
	include($conf["base_path"] ."lib/thumbnail.php");
    $id= $_POST['id'];	
	$cate_id = 0; //分类
	//date_default_timezone_set('Asia/Shanghai');	
	$time=date('Y-m-d H:i:s');
  
	$img = $_FILES['img']['name'];	
	$imgname = explode('.',$img);	
	$count = count($imgname)-1;
	$imgn = time().'.'.$imgname[$count];
	$imgn_1 = time().'_1.'.$imgname[$count];
	$query = "UPDATE $TBL_DEAL SET img='$imgn_1' where type=5";		
    $res = mysql_query($query) or die(mysql_error());	
	if($_FILES['img']['name']!='')
	{
		$img_file =$conf['fck_upload'] . "adv";
		$file_full = $img_file."/".$imgn;
		$upload_file = $_FILES['img']['tmp_name'];          
		move_uploaded_file($upload_file, $file_full);  
		$oldpic = $img_file =$conf['fck_upload'] . "adv/".$imgn;
		$newpic = $img_file =$conf['fck_upload'] . "adv/".$imgn_1;	
		new resizeimage($oldpic, "120", "200", "0",$newpic);//缩略圖	
	}
	
	MyNotice("店長圖片設置成功", 1, "../news.php");
	exit(0);  
  
?>